CXX=g++
CXFLAGS=-ansi -g -Wall -lm
MINICPPUNIT_SRC=MiniCppUnit-2.5/MiniCppUnit.cxx MiniCppUnit-2.5/TestsRunner.cxx

all: test
	./pigasus-types-test
	./loadcsv-test
	./cast-test
	./serialization-test
	./formatstring-test

test: pigasus-types-test loadcsv-test cast-test serialization-test formatstring-test

pigasus-types-test: pigasus-types-test.o
	$(CXX) $(CXFLAGS) -o pigasus-types-test \
		../src/pigasus-types.o \
		pigasus-types-test.cc $(MINICPPUNIT_SRC)

loadcsv-test: loadcsv-test.o
	$(CXX) $(CXFLAGS) -o loadcsv-test \
		../src/pigasus-types.o \
		../src/loadcsv.o \
		loadcsv-test.cc $(MINICPPUNIT_SRC)

cast-test: cast-test.o
	$(CXX) $(CXFLAGS) -o cast-test \
		../src/pigasus-types.o \
		../src/cast.o \
		cast-test.cc $(MINICPPUNIT_SRC)
	
serialization-test: serialization-test.o
	$(CXX) $(CXFLAGS) -o serialization-test \
		../src/pigasus-types.o \
		../src/serialization.o \
		serialization-test.cc $(MINICPPUNIT_SRC)

formatstring-test: formatstring-test.o
	$(CXX) $(CXFLAGS) -o formatstring-test \
		../src/pigasus-types.o \
		../src/formatstring.o \
		formatstring-test.cc $(MINICPPUNIT_SRC)

